package com.neusoft.restaurant.mapper;

import com.neusoft.restaurant.entity.LoginUserVo;
import com.neusoft.restaurant.entity.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @author: zhongda
 * @createTime: 2023/11/24 15:37
 * @email: fromzhongda@163.com
 * @description:
 */
@Mapper
public interface SysUserMapper {
    @Select("select user_id, dept_id, user_name, nick_name, email, avatar, phonenumber, password, sex, status from sys_user where user_name = #{userName}")
    SysUser selectUserByUserName(String userName);


    /**
     * 新增用户信息
     *
     * @param user 用户信息
     * @return 结果
     */
    @Insert({ "insert into sys_user(user_id,user_name, nick_name, email, phonenumber,sex,avatar,password,status) values( #{userId},#{userName}, #{nickName}, #{email}, #{phonenumber}, #{sex}, #{avatar}, #{password}, #{status})" })
//    @Options(useGeneratedKeys = true, keyProperty = "user_id")
    int insertUser(SysUser user);


}
